﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Skyhook.Isometry
{
    internal class WorldObjectFactory
    {
        WorldTileMap TileMap;

        public WorldObjectFactory(WorldTileMap tilemap)
        {
            if (tilemap == null)
            {
                throw new Exception("TileMap is null.");
            }

            TileMap = tilemap;
        }

        public WorldObject CreateObject()
        {
            WorldObject worldobject = new WorldObject(TileMap.UpdateObjectTile,TileMap.RemoveObject,TileMap.Width,TileMap.Height);
            TileMap.AddObject(worldobject);
            return worldobject;
        }
    }
}
